package teaching.io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class OutputStreamTest {

  /**
   * ����.
   * @param args ���������
   */
  public static void main(String[] args) {
    OutputStream os = null;
    try {
      String str = "�ú�ѧϰ���������ϡ�";
      byte[] b = str.getBytes();
      os = new FileOutputStream("d:/aaa.txt", true);
      os.write(b);
      System.out.println("OK.");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      try {
        os.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
  }
}
